#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 110;
struct node
{
	int t;
	int l;
	int r;
}a[maxn];
bool cmp(node a,node b)
{
	return a.t<b.t;
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n,m;
		cin>>n>>m;
		for(int i = 0;i<n;i++)
		{
			cin>>a[i].t>>a[i].l>>a[i].r;
		}
		sort(a,a+n,cmp);
		int cnt = 0;
		int now = m;
		int nowt = 0;
		int del = 0;
		int flag = 0;
		for(int i = 0;i<n;i++)
		{
			if(now<a[i].l)
			{
				cnt = a[i].l-now;
				if(cnt+nowt>a[i].t)
				{
					flag = 1;
					break;
				}
				else
				{
					nowt = a[i].t;
					now = a[i].l;
				}
			}
			else if(now>a[i].r)
			{
				cnt = now-a[i].r;
				if(cnt+nowt>a[i].t)
				{
					flag = 1;
					break;
				}
				else 
				{
					nowt = a[i].t;
					now = a[i].r;
				}
			}
			
		}
		if(flag) cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}
